A virtual machine (VM) is a software implementation of a physical machine (i.e., a computer system) that executes software instructions in a manner identical to the physical machine In other words, a VM is an efficient, isolated duplicate of a physical machine VMs usually exist in two varieties—system VMs and process VMs. A system VM acts as a comprehensive system platform that supports the execution of an operating system (OS). A process VM runs a single program (i.e., it supports a single process). Software executing in a VM is limited to the resources and abstractions provided by that VM. In other words, the software cannot operate or access elements outside of the VM. VMs typically store objects in a region of VM memory referred to as a memory heap.
Garbage collection is a mechanism used for memory management in computer systems. A garbage collector functions by reclaiming memory (e.g., in the memory heap) occupied by objects that are no longer in use by an application or computer system (i.e. garbage). During the process of garbage collection, a garbage collector may relocate a live object (i.e., non-garbage) within the memory heap of the VM. When garbage collection is occurring, the state of the VM and the heap (and therefore the objects in the heap) are opaque to a user. In other words, during garbage collection, the internal state of the VM is usually not accessible outside of the VM.
A debugger is a tool (e.g., a software application) for testing and debugging programs and/or VMs executing the programs. Specifically, a debugger allows a user to observe and/or modify the internal state of a process (i.e., VM and program) including the value(s) stored at one or more locations in memory (e.g., a memory heap). A debugger also allows a user to set memory watchpoints on specific memory locations (or breakpoints on specific portions of executing code). When the process reads from and/or writes to a memory location associated with a memory watchpoint or breakpoint, the process may be halted for user inspection and debugging.